package com.mhkj.execute.plan.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import com.mhkj.base.busiMode.entity.BusiModel;
import com.mhkj.base.busiType.entity.BusinessType;
import com.mhkj.revise.plan.entity.Plan;
import com.mics.core.common.validate.annotation.NotNull;
import com.mics.core.common.validate.annotation.Validate;
import com.mics.core.system.base.entity.BaseDomain;
import com.mics.core.system.rbac.entity.Dictionary;

/**
 * 计划节点
 * 
 * @author mics
 * @date 2018年7月5日
 * @version 1.0
 */
@Entity
@Table(name = "t_plan_node_new")
@Validate
public class PlanNodeNew extends BaseDomain {
	/**
	 * 序列号
	 */
	private static final long serialVersionUID = 6549120844181038972L;
	/**
	 * 计划
	 */
	@JoinColumn(name = "plan_id")
	@ManyToOne(fetch = FetchType.LAZY)
	private Plan plan;

	/**
	 * 节点名称
	 */
	@Column(name = "node_name", length = 48)
	@NotNull(message = "节点名称不能为空！")
	private String nodeName;

	/**
	 * 业务模块
	 */
	@JoinColumn(name = "business_id")
	@ManyToOne(fetch = FetchType.LAZY)
	private BusinessType business;

	/**
	 * 节点性质
	 */
	@NotNull(message = "节点性质不能为空")
	@JoinColumn(name = "node_property_id")
	@ManyToOne(fetch = FetchType.LAZY)
	private Dictionary nodeProperty;

	/**
	 * 完成标准
	 */
	@Column(name = "complete_standard", length = 128)
	private String completeStandard;

	/**
	 * 开始时间
	 */
	@Column(name = "begin_date")
	@Temporal(TemporalType.DATE)
	private Date beginDate;
	/**
	 * 结束时间
	 */
	@Column(name = "end_date")
	@Temporal(TemporalType.DATE)
	private Date endDate;

	/**
	 * 工期
	 */
	@Column(name = "deadline")
	private int deadline = 0;

	/**
	 * 工期说明
	 */
	@Column(name = "deadline_desc")
	private String deadlineDesc;

	/**
	 * 进度（百分位）
	 */
	private double rate;

	/**
	 * 正常推迟天数
	 */
	@Column(name = "delay_day")
	private int delayDay = 0;

	/**
	 * 延期到时间
	 */
	@Column(name = "delay_date")
	private Date delayDate;
	/**
	 * 延期次数
	 */
	@Column(name = "delay_num")
	private Integer delayNum=0;

	/**
	 * 逾期天数
	 */
	@Column(name = "over_day")
	private int overDay = 0;
	/**
	 * 责任单位
	 */
	@Column(name = "company_id", length = 48)
	private String companyId;

	/**
	 * 责任单位
	 */
	@Transient
	private String companyName;
	/**
	 * 责任部门
	 */
	@Column(name = "office_id", length = 48)
	private String officeId;

	/**
	 * 部门名称
	 */
	@Transient
	private String officeName;
	/**
	 * 责任岗位
	 */
	@Column(name = "post_id", length = 48)
	private String postId;
	
	
	/**
	 * 责任人
	 */
	@Column(name = "post_person", length = 48)
	private String postPerson;

	/**
	 * 责任人名称
	 */
	@Transient
	private String postPersonName;

	/**
	 * 岗位名称
	 */
	@Transient
	private String postName;

	/**
	 * 监督
	 */
	@Column(name = "supervise", length = 48)
	private String supervise;

	/**
	 * 模块
	 */
	@JoinColumn(name = "model_id")
	@ManyToOne(fetch = FetchType.LAZY)
	private BusiModel busiModel;

	/**
	 * 备注
	 */
	@Column(name = "remark")
	private String remark;

	/**
	 * 状态:1未开始、2进行中 、5、已完成 6、延期完成 7、逾期
	 */
	@Column(name = "state")
	private int state = 1;

	/**
	 * 风险状态  0 无状态 1、有风险  2、失控
	 */
	@Column(name="risk_state")
	private int riskState=0;
	
	/**
	 * 完成时间
	 */
	@Column(name = "complete_date")
	@Temporal(TemporalType.DATE)
	private Date completeDate;
	

	/**
	 * 配合岗位
	 */
	@Column(name = "cooperate_post_id", length = 48)
	private String cooperatePostId;
	

	/**
	 * 配合人
	 */
	@Column(name = "cooperate_post_person", length = 48)
	private String cooperatePostPerson;

	/**
	 * 配合人名称
	 */
	@Transient
	private String cooperatePostPersonName;

	/**
	 * 配合事项
	 */
	@Column(name = "cooperate_matters")
	private String cooperateMatters;

	/**
	 * 配合开始时间
	 */
	@Column(name = "cooperate_begin_date")
	@Temporal(TemporalType.DATE)
	private Date cooperateBeginDate;

	/**
	 * 配合结束时间
	 */
	@Column(name = "cooperate_end_date")
	@Temporal(TemporalType.DATE)
	private Date cooperateEndDate;
	
	/**
	 * 审批状态:0、未提交 1已提交、2审批中 、3、已完成4、未通过
	 */
	@Column(name="audit_state")
	private int auditState=0;
	/**
	 * 审批时间
	 */
	@Column(name="audit_date")
	@Temporal(TemporalType.DATE)
	private Date auditDate;
	/**
	 * 审批结果
	 */
	@Column(name="audit_result")
	private String auditResult;

	/**
	 * 来源标记
	 */
	@Column(name = "sign")
	private String sign;
	
	public Date getDelayDate() {
		return delayDate;
	}

	public void setDelayDate(Date delayDate) {
		this.delayDate = delayDate;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public String getNodeName() {
		return nodeName;
	}

	public void setNodeName(String nodeName) {
		this.nodeName = nodeName;
	}

	public Date getBeginDate() {
		return beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public int getDeadline() {
		return deadline;
	}

	public void setDeadline(int deadline) {
		this.deadline = deadline;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public String getCompleteStandard() {
		return completeStandard;
	}

	public void setCompleteStandard(String completeStandard) {
		this.completeStandard = completeStandard;
	}

	public String getOfficeId() {
		return officeId;
	}

	public void setOfficeId(String officeId) {
		this.officeId = officeId;
	}

	public String getOfficeName() {
		return officeName;
	}

	public void setOfficeName(String officeName) {
		this.officeName = officeName;
	}

	public Plan getPlan() {
		return plan;
	}

	public void setPlan(Plan plan) {
		this.plan = plan;
	}

	public BusinessType getBusiness() {
		return business;
	}

	public void setPhase(BusinessType business) {
		this.business = business;
	}

	public BusiModel getBusiModel() {
		return busiModel;
	}

	public void setBusiModel(BusiModel busiModel) {
		this.busiModel = busiModel;
	}

	public int getDelayDay() {
		return delayDay;
	}

	public void setDelayDay(int delayDay) {
		this.delayDay = delayDay;
	}

	public int getOverDay() {
		return overDay;
	}

	public void setOverDay(int overDay) {
		this.overDay = overDay;
	}

	public double getRate() {
		return rate;
	}

	public void setRate(double rate) {
		this.rate = rate;
	}

	public Date getCompleteDate() {
		return completeDate;
	}

	public void setCompleteDate(Date completeDate) {
		this.completeDate = completeDate;
	}

	public Dictionary getNodeProperty() {
		return nodeProperty;
	}

	public void setNodeProperty(Dictionary nodeProperty) {
		this.nodeProperty = nodeProperty;
	}

	public String getDeadlineDesc() {
		return deadlineDesc;
	}

	public void setDeadlineDesc(String deadlineDesc) {
		this.deadlineDesc = deadlineDesc;
	}

	public String getCompanyId() {
		return companyId;
	}

	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}

	public String getPostId() {
		return postId;
	}

	public void setPostId(String postId) {
		this.postId = postId;
	}

	public String getPostName() {
		return postName;
	}

	public void setPostName(String postName) {
		this.postName = postName;
	}

	public void setBusiness(BusinessType business) {
		this.business = business;
	}

	public String getSupervise() {
		return supervise;
	}

	public void setSupervise(String supervise) {
		this.supervise = supervise;
	}
	
	public String getCooperatePostId() {
		return cooperatePostId;
	}

	public void setCooperatePostId(String cooperatePostId) {
		this.cooperatePostId = cooperatePostId;
	}

	public String getCooperateMatters() {
		return cooperateMatters;
	}

	public void setCooperateMatters(String cooperateMatters) {
		this.cooperateMatters = cooperateMatters;
	}

	public Date getCooperateBeginDate() {
		return cooperateBeginDate;
	}

	public void setCooperateBeginDate(Date cooperateBeginDate) {
		this.cooperateBeginDate = cooperateBeginDate;
	}

	public Date getCooperateEndDate() {
		return cooperateEndDate;
	}

	public void setCooperateEndDate(Date cooperateEndDate) {
		this.cooperateEndDate = cooperateEndDate;
	}

	public Integer getDelayNum() {
		return delayNum;
	}

	public void setDelayNum(Integer delayNum) {
		this.delayNum = delayNum;
	}

	public String getSign() {
		return sign;
	}

	public void setSign(String sign) {
		this.sign = sign;
	}

	public String getPostPerson() {
		return postPerson;
	}

	public void setPostPerson(String postPerson) {
		this.postPerson = postPerson;
	}

	public String getCooperatePostPerson() {
		return cooperatePostPerson;
	}

	public void setCooperatePostPerson(String cooperatePostPerson) {
		this.cooperatePostPerson = cooperatePostPerson;
	}

	public String getPostPersonName() {
		return postPersonName;
	}

	public void setPostPersonName(String postPersonName) {
		this.postPersonName = postPersonName;
	}

	public String getCooperatePostPersonName() {
		return cooperatePostPersonName;
	}

	public void setCooperatePostPersonName(String cooperatePostPersonName) {
		this.cooperatePostPersonName = cooperatePostPersonName;
	}

	public int getRiskState() {
		return riskState;
	}

	public void setRiskState(int riskState) {
		this.riskState = riskState;
	}

	public int getAuditState() {
		return auditState;
	}

	public void setAuditState(int auditState) {
		this.auditState = auditState;
	}

	public Date getAuditDate() {
		return auditDate;
	}

	public void setAuditDate(Date auditDate) {
		this.auditDate = auditDate;
	}

	public String getAuditResult() {
		return auditResult;
	}

	public void setAuditResult(String auditResult) {
		this.auditResult = auditResult;
	}

}
